import sys
from utils.runcase import do_case

class data_driven:
    def __init__(self):
        self.re = do_case()
    def driven_it(self):
        li,sheets,rw_num = self.re.read_excel_test('case')
        #print(li)
        for j in range(1,rw_num):
            if len(li) != 0:
                i = sheets.row_values(j)
                print(i)
                __import__('testcase.'+ i[4])
                mod = sys.modules['testcase.' + i[4]]
                obj = getattr(mod,i[5])
                mtd = getattr(obj(),i[6])
                if i[7] == '':
                    mtd()
                else:
                    mtd(i[7])


if __name__ == '__main__':
    data_driven().driven_it()

